import pandas as pdimport numpy as npimport plotly.express as pximport polars as plimport plotly.express as pximport plotly.graph_objects as gofrom plotly.subplots import make_subplots# Define custom color palettecolors = ["#0081a7", "#00afb9", "#fdfcdc", "#fed9b7", "#f07167"]
Unlocking Education: The Journey Behind School Attendance
The First Step: Mapping a Child’s Right
Education is the doorway to opportunity, yet millions are still left standing outside that door.Around the world, school attendance rates tell a powerful story — a story of inclusion, struggle, and progress.To begin, let’s take a global view. Where are children making it into the classroom — and where are they being left behind?
This map paints a striking picture: Some nations shine brightly, nearing full enrollment, while others reveal heartbreaking gaps, reminding us of the unevenness in access to learning.
Boys and Girls: Are We Closing the Gap?
While access has improved, gender disparities remain in many regions. How do boys’ and girls’ school attendance rates compare?
In an ideal world, every dot would fall perfectly on the diagonal line — signaling equality. Yet reality shows us deviations:
In some nations, girls still lag behind.
In others, boys are increasingly vulnerable to dropout.
Understanding these differences is crucial for shaping targeted, inclusive education policies.
A Deeper Dive: How Some Countries Are Changing Over Time
Progress isn’t measured only by snapshots — but by journeys.Take, for instance, Afghanistan. A nation marked by decades of turmoil, yet striving to move forward.
While fluctuations remain, the overall picture reveals resilience.Every year of improvement represents thousands more children learning, dreaming, and building toward a different future.
Rising Together: Stories of Momentum
Beyond individual nations, we can observe the collective movement of countries making major strides.
Code
top3 = latest_df.sort_values("obs_value", ascending=False).head(3)["country"]area_df = df_total[df_total["country"].isin(top3)]plt.figure(figsize=(10,6))for i, c inenumerate(top3): sub = area_df[area_df["country"] == c] plt.fill_between(sub["time_period"], sub["obs_value"], alpha=0.5, color=palette[i], label=c)plt.legend()plt.grid(True, linestyle="--", alpha=0.5)plt.tight_layout()plt.show()
This area chart shows not only how top-performing countries have improved — but also the sheer momentum behind educational growth when communities, governments, and families come together.It reminds us that while the starting points differ, progress is possible everywhere.
Final Reflections: More Than Numbers
Behind every data point we have seen lies a child’s story —A story of hope, perseverance, and potential.Education is not a luxury.It is the engine of healthier societies, stronger economies, and more peaceful nations.As we visualize these global patterns, we must remember:Each additional child stepping into a classroom brings the entire world closer to a brighter tomorrow.